/*
 * 文件名：Entrance.java
 * 版权：Copyright by www.newlixon.com/
 * 描述：
 * 修改人： Jasmine
 * 修改时间：2020年06月03日
 * 跟踪单号：
 * 修改单号：
 * 修改内容：
 */
package com.demo;

import org.springframework.core.type.ClassMetadata;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.SimpleMetadataReaderFactory;
import org.springframework.util.StringUtils;

import java.io.IOException;

/**
 * @author Jasmine
 * @version 1.0
 * @date 2020-06-03 12:18:18
 * @see Entrance
 * @since JDK1.8
 */
public class Entrance {


	public static void classMetaTest() throws IOException {
		SimpleMetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory();
		MetadataReader metadataReader = metadataReaderFactory.getMetadataReader("com.demo.bean.MetaDemo");

		ClassMetadata classMetadata = metadataReader.getClassMetadata();
		System.out.println("当前class名称 " + classMetadata.getClassName());
		System.out.println("当前class是否为接口 " + classMetadata.isInterface());
		System.out.println("当前class是否为注解 " + classMetadata.isAnnotation());
		System.out.println("当前class是否为抽象类 " + classMetadata.isInterface());
		System.out.println("当前class是否允许创建 " + classMetadata.isConcrete());
		System.out.println("当前class是否为final修饰 " + classMetadata.isFinal());
		System.out.println("当前class是否独立 " + classMetadata.isIndependent());
		System.out.println("当前class的超类 "+ classMetadata.getSuperClassName());
		String[] interfaceNames = classMetadata.getInterfaceNames();
		System.out.println("当前class所有接口名称 " + StringUtils.arrayToDelimitedString(interfaceNames,","));
		;
		System.out.println("getMemberClassNames " + classMetadata.getMemberClassNames());
		System.out.println();
	}

	public static void main(String[] args) throws IOException {
		classMetaTest();
/*
		SimpleMetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory();
		MetadataReader metadataReader = metadataReaderFactory.getMetadataReader("com.demo.bean.User");
		ClassMetadata classMetadata = metadataReader.getClassMetadata();
		System.out.println(classMetadata.getEnclosingClassName());
		System.out.println(classMetadata.getSuperClassName());
		System.out.println(11);*/
	}
}
